devfandomcom-20200223-history
Talk:QuickDiff
__TOC__ Appreciation Feature I have a suggestion - The appreciate diff feature should be included in the diff modal. —''Monochromatic Bunny'' | ☎ 02:26, August 24, 2016 (UTC) :When fetching the diff, QuickDiff adds a diffonly=1 parameter to the URL (to keep the request as small as possible), which is equivalent to having the "Hide page content below diffs" option ticked in your preferences. However, it seems there's currently a bug where the appreciate button isn't shown when that option is enabled. Once that bug is fixed, support for the appreciate button will be easy to add! - OneTwoThreeFall (talk) 09:42, August 24, 2016 (UTC) :: Ah, thank you! :) —''Monochromatic Bunny'' | ☎ 22:07, August 24, 2016 (UTC) Undo Button Can you add a button for reverting the edit? Dai ca superman (talk) 10:35, August 24, 2016 (UTC) :There should already be a undo link (and a rollback link too if you have the permissions). Is this what you mean? - OneTwoThreeFall (talk) 11:04, August 24, 2016 (UTC) ::Ah, I know that, but it sometimes pretty hard to click exactly those links when browsing by phone, so if you can make an option that can add undo/rollback button at the end of diff modal, I'm very appreciated Dai ca superman (talk) 12:05, August 24, 2016 (UTC) :::The main action links (edit, undo, rollback, patrol) are now added as buttons to the modal footer. Is this better when browsing on a phone? - OneTwoThreeFall (talk) 12:28, August 25, 2016 (UTC) ::::Thank you, it works good on Chrome and with some additional CSS code it works ok on UCBrowser. Other thing, I've noticed your code sometimes failed to get the content on the very first attempt. Dai ca superman (talk) 16:18, August 27, 2016 (UTC) :::::Good to hear! I've noticed that too, but the issue's been rather hard to reproduce. I recently made some changes to lower the chances of the diff not loading correctly at first, so hopefully it won't happen any more. - OneTwoThreeFall (talk) 17:57, August 28, 2016 (UTC) ::::::I've used your old code just before you update your modal layout on some wikis and it seem it doesn't suffer with the same issue. Dai ca superman (talk) 15:04, August 29, 2016 (UTC) :::::::Yes, this issue only happens with the new modal style, as using Wikia's new modal layout requires loading some code before it's used and I try to cache that code to save loading it multiple times. I've just made another change in hope of preventing the issue. - OneTwoThreeFall (talk) 11:09, August 30, 2016 (UTC) Vietnamese translation vi: { error: 'Đã có sự cố xảy ra khi tải trang tại đường dẫn “%url”.', loading: 'Đang tải…', title: 'Thay đổi: %pagename' } Dai ca superman (talk) 15:01, August 29, 2016 (UTC) :Added, thank you! - OneTwoThreeFall (talk) 11:11, August 30, 2016 (UTC) Spanish Translation es: { error: 'Un error ha occurido mientras se extraia la página en “%url”.', loading: 'Cargando...', titles: 'Cambios: %pagename' } Spanish translation by Dorumin --'Sharkie' 02:30, October 16, 2016 (UTC) :Thanks! I've added it with a credit to Dorumin. - OneTwoThreeFall (talk) 09:04, October 24, 2016 (UTC) Dutch translation nl: { error: 'Er ging iets verkeerd bij het ophalen van de pagina op “%url”.', loading: 'Laden…', title: 'Wijzigingen: %pagename' }, —'Mainframe98 talk· ' 11:05, October 24, 2016 (UTC) :Added. Thanks for the translation! - OneTwoThreeFall (talk) 11:21, October 24, 2016 (UTC) Diff link I think a button to open or copy the diff link displayed should be added: in history pages, you can navigate through each revision diffs with this script, however you have no way to know/copy/open the diff link, therefore it makes quite hard copy and pasting diff links (like to show a diff to someone else). Also, I believe the AJAX undo button has no translation. leviathan_89 16:47, June 4, 2017 (UTC) : AJAX Undo button is a result of AjaxUndo script. You can add translations for it in MediaWiki:AjaxUndo/code.js. -- Cube-shaped 17:52, June 4, 2017 (UTC) :Good idea! Would opening (as in, having the button be an actual link) or copying the link be better? I'm not sure how well supported copy/paste is across browsers, but it may be doable. - OneTwoThreeFall talk 17:23, June 5, 2017 (UTC) ::I'm not sure myself. The "actual link" would probably cover both uses since someone can always right click copy the link. If I can also suggest other improvements, I think this script should copy some functions used by RecentChangesMultiple: it uses icons, a viewer for new pages and also one for file uploads. I think that should be the aim of this script as well: letting people inspect every edits without leaving RC and RecentChangesMultiple does that very well. leviathan_89 19:18, June 5, 2017 (UTC) :::As you mention, you can right-click the link to copy it, so I've added an "open link" button that opens the diff in a new tab. :::Hmm, a preview for files and new pages seems useful, but I'm not sure it's entirely within the scope of QuickDiff. I'll look into it, though maybe it'd work better as a separate companion script instead? - OneTwoThreeFall talk 15:51, June 6, 2017 (UTC) ::::Or as an extra optional feature for this one. As I said, you can take a look at RecentChangesMultiple to see what I'm talking about. leviathan_89 14:58, June 7, 2017 (UTC) Opening in a new tab Is it possible to allow Cmd/Ctrl-clicking on a diff link to open it in a new tab? I know there's already an "open link" button, but it's an extra click and extra time waiting for the modal to load when you sometimes just need to see the full page. I don't think normal browser behavior should be overridden, and I can't think of any negative effects of implementing this for people who don't use Cmd/Ctrl-click. --Iiii I I I (talk) 00:18, June 19, 2017 (UTC) :You're quite right, it shouldn't be overriding normal browser features. It'll now (alt, ctrl, cmd, shift), so cmd/ctrl-clicks should work again. - OneTwoThreeFall talk 08:44, June 19, 2017 (UTC) ::Thanks! --Iiii I I I (talk) 16:23, June 19, 2017 (UTC) One downside of QDModal ...is that I can no longer click the Esc button to exit it. Could that be fixed? -- Cube-shaped 19:55, February 15, 2018 (UTC) : ! -- Cube-shaped 08:01, February 16, 2018 (UTC) :: No problem! I tried to keep things mostly the same, but didn't know the previous modal code handled that… - OneTwoThreeFall talk 08:03, February 16, 2018 (UTC) ::: Another downside: this fantastic script isn't a Dev library :p ::: But in seriousness, I would love a Modal-js that looks modern and also doesn't need to fetch uiFactory components. • speedy • ��︎ • • 09:46, February 17, 2018 (UTC) :::: Actually, it is a separate library! I like to think the code isn't too complex, but I should really write a doc page for it. - OneTwoThreeFall talk 16:00, February 17, 2018 (UTC) :::::Oh, forgot my question - did you consider renaming it to Modal-js, to fit loose convention of -js lib suffix? • speedy • ��︎ • • 16:49, February 17, 2018 (UTC) ::::::Hmm, I don't know… Modal-js already seems to be a thing. I named it QD'modal because it was written for '''Q'uick'D'''iff and seemed an alright name. Not sure it's worth the effort to rename, to be honest! :) - OneTwoThreeFall talk 17:11, February 17, 2018 (UTC) RTE fatal bug This script prevents RTE's link switch from working. The issue is that mw.Uri shouldn't be constructed for links that start with javascript: or don't contain diff. '• speedy • ��︎ • • 17:14, November 28, 2018 (UTC) :What do you mean by link switch? The 'Source' and Visual' buttons above rich-text editor work fine for me. - OneTwoThreeFall talk 12:52, November 29, 2018 (UTC) ::Strange, can't reproduce it now. But I do think tests for target.href presence and validity (something like /https?:\/\/\s\S+(\?|&)diff=/ should be done. ::The other option is using code like this: ::$(document.body).on("click.quickdiff", "ahref*='diff='", linkClickHandler); ::It's a looser safety for when other developers do something really dumb, but it's good to be careful :) • speedy • ��︎ • • 16:52, November 29, 2018 (UTC) :::The click handler currently uses ahref as selector, so missing href attribute should never happen. It can't be any more precise though as it also handles and links, neither which use a diff URL parameter. :::Since the underlying issue is that mw.Uri throws if it can't parse the URL, might be best to wrap it in a try/catch block and simply return if it fails. - OneTwoThreeFall talk 03:36, November 30, 2018 (UTC)